<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
	
<html>
<head>
<script src="<c:url value="/resources/script/jquery/jquery-1.8.3.js"/>"></script>
<script>
	function searchPost(){
		var floorBox = $("#searchFloor").val();
		if(floorBox != ""){
			document.formSearch.submit();
		}else{
			alert("Floor has not been selected");
		}
	}
</script>
</head>
<body>
<table>

		<tr>
		<td><h2>Find Item By Location</h2></td>
		</tr>
		<tr>
			<td>
				<form name="formSearch" action="<c:url value="onLocation"/>" method="post">
				<table id="rounded-corner">
				<tr>
					<td align="right" width="80"><label> Floor :</label> </td>
					<td>
						<select name="searchFloor" id="searchFloor">
							<option value="${floor}">${floor}</option>
							<c:forEach var="floors" items="${floors}" varStatus="status">
								<option value="${floors.floorName}">${floors.floorName}</option>
							</c:forEach>
						</select>
						<a href="#" onclick="searchPost()">
							<img alt="" src="<c:url value="/resources/images/images/search.png"/>">
						</a>
					</td>
				</tr>
				<tr>
					<td align="right" width="80"><label> Position :</label></td>
					<td>
						<input type="hidden" name="searchPosFlo" value="${floor}"/>
						<select name="searchPosition">
							<option value="${position}">${position}</option>
							<c:forEach var="location" items="${location}" varStatus="status">
								<option value="${location.position}">${location.position}</option>
							</c:forEach>
						</select>
						<a onclick="document.formSearch.submit()" href="<c:url value="#"/>" >
							<img alt="" src="<c:url value="/resources/images/images/search.png"/>">
						</a>
					</td>
				</tr>
				</table>
				</form>
			</td>
		</tr>
		<tr>
				<td>
					<table id="rounded-corner"
						summary="2007 Major IT Companies' Profit">
						<thead>
							<tr>
								<th scope="col" class="rounded-company"></th>
								<th scope="col" class="rounded"><b>Code</b>
								</th>
								<th scope="col" class="rounded"><b>Category</b>
								</th>
								<th scope="col" class="rounded"><b>Type</b>
								</th>
								<th scope="col" class="rounded"><b>Brand</b>
								</th>
								<th scope="col" class="rounded-q4"><b>Condition</b>
								</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="searchItem" items="${searchItem}" varStatus="status">
								<tr>
									<td>${status.index + pagingInfo.offset + 1}</td>
									<td>${searchItem.item.code}</td>
									<td>${searchItem.item.category.categoryName}</td>
									<td>${searchItem.item.type.itemType}</td>
									<td>${searchItem.item.brand.brandName}</td>
									<td>${searchItem.item.condition}</td>
								</tr>
							</c:forEach>
						</tbody>
						<tfoot>
							<tr>
								<td colspan="5" class="rounded-foot-left"><em>@Xsis
										Mitra Utama</em>
								</td>
								<td class="rounded-foot-right">&nbsp;</td>

							</tr>
						</tfoot>
					</table>
				</td>
			</tr>
		</table>
</body>
</html>